import { createRouter, createWebHistory } from 'vue-router';
import Main from '../views/Main.vue'
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Mall from '../views/Mall.vue'
import Login from '../views/Login.vue'
import NotFound from '../views/NotFound.vue';
 
const routes = [
    {
        path: '/',
        name: 'main',
        component: Main,
        redirect: '/home',
        /* children: [
            {
                path: 'home',
                name: 'home',
                component: Home,
            },
            {
                path: 'user',
                name: 'user',
                component: User,
            },
            {
                path: 'mall',
                name: 'mall',
                component: Mall,
            }
        ] */
    },
    {
        path: '/login',
        name: 'login',
        component: Login,
    },
    {
        path: '/404',
        name: '404',
        component: NotFound
    }
];
 
const router = createRouter({
    // 设置路由模式
    history: createWebHistory(),
    routes,
});
 
export default router;